package br.com.caelum.vraptor.controller;

import javax.inject.Inject;

import br.com.caelum.vraptor.Controller;
import br.com.caelum.vraptor.Path;
import br.com.caelum.vraptor.Result;
import br.urca.interceptor.InterceptResource;
import br.urca.session.UsuarioLogado;

@Controller
@InterceptResource
public class IndexController {
	
	private UsuarioLogado usuarioLogado;
	private Result result;

	public IndexController() { }
	
	@Inject
	public IndexController(UsuarioLogado usuarioLogado, Result result) {
		this.result = result;
		this.usuarioLogado = usuarioLogado;
	}

	@Path("/")
	public void index() {
		//result.redirectTo(LancamentoNotasController.class).index();
		result.include("funcionario",usuarioLogado.getFuncionario());
		result.include("variable", "Tudo OK!");
	}
}